//
//  NSString+ZCNSString.m
//  A Learning Walk
//
//  Created by dllo on 16/6/16.
//  Copyright © 2016年 战斗民族. All rights reserved.
//

#import "NSString+ZCNSString.h"

@implementation NSString (ZCNSString)


// 根据文字内容计算高度
- (CGRect)sizeForFont:(NSInteger)font size:(CGSize)size{
    
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:font], NSFontAttributeName,nil];
    
    CGRect rect = [self boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    return rect;
}
@end
